/**
 * Copyright (C) 2013 Daniel Gee.
 * See LICENSE.txt for more details.
 */
package quickcheck.generators;

import net.java.quickcheck.Generator;
import net.java.quickcheck.generator.PrimitiveGenerators;

import com.rl.gui.Appearance;

/**
 * Generates random {@link Appearance} instances.
 * 
 * @author Daniel Gee
 */
public class AppearanceGenerator implements Generator<Appearance>
{
	/**
	 * Random printable ASCII characters.
	 */
	private final Generator<Character> charGen;

	/**
	 * Random colors.
	 */
	private final ColorGenerator colorGen;

	/**
	 * Makes a new AppearanceGenerator.
	 */
	public AppearanceGenerator()
	{
		this.colorGen = new ColorGenerator();
		this.charGen = PrimitiveGenerators.characters(' ', '~');
	}

	/**
	 * @see net.java.quickcheck.Generator#next()
	 */
	@Override
	public Appearance next()
	{
		return new Appearance(this.charGen.next(), this.colorGen.next());
	}
}
